<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Templates</title>
<meta name="GENERATOR" content="WinCHM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>

<body>

<p>As well as the specialized formats ResourceBlender generates, templates can also be used to generate resources. This allows a custom filename and format to be used.</p>
<p>Tags can be used when specifying the format for different parts of each bundle which will be replaced by context dependant text like the bundle name.</p>
<p><strong>Note:</strong> Only a limited set are available when specifying a <em>filename</em>, <em>file start</em> or <em>file end</em> (the element and translation are only relevant in the context of each translation).</p>
<img src="images/express-templates.png" alt="Editing a template" class="centered" />

<h2><a name="tags">Available Tags</a></h2>
<table class="wikitable">
    <tr>
        <th><strong>Tag Name</strong></th>
        <th><strong>Valid</strong></th>
    </tr>
    <tr>
        <td>&#123;=LanguageCode&#125;</td>
        <td>Always</td>
    </tr>
    <tr>
        <td>&#123;=Bundle&#125;</td>
        <td>Always</td>
    </tr>
    <tr>
        <td>&#123;=Element&#125;</td>
        <td>Only for element format</td>
    </tr>
    <tr>
        <td>&#123;=Translation&#125;</td>
        <td>Only for element format</td>
    </tr>
</table>
<p>When a template tag is available, clicking the toolbar button for that tag will insert it at the current cursor location, which saves typing it out every time.</p>
<p>The full editor can be opened by clicking the <em>Expand</em> button next to each field.</p>


<h2><a name="included">Included Templates</a></h2>
<p>Templates for PHP arrays and PHP definitions are included with ResourceBlender. These should help you get started creating custom templates.</p>

<h3><a name="phparray">PHP Array</a></h3>
<table summary="The PHP array format">
    <tr>
        <td width="100px"><strong>Filename</strong></td>
        <td>&#123;=Bundle&#125;_&#123;=LanguageCode&#125;.php</td>
    </tr>
    <tr>
        <td><strong>File Start</strong></td>
        <td>&lt;?php $&#123;=Bundle&#125; = array(</td>
    </tr>
    <tr>
        <td><strong>File End</strong></td>
        <td>);&nbsp;?&gt;</td>
    </tr>
    <tr>
        <td><strong>Element</strong></td>
        <td>"&#123;=Element&#125;" =&gt; "&#123;=Translation&#125;",</td>
    </tr>
</table>

<h3><a name="phpdefinitions">PHP Definitions</a></h3>
<table summary="The PHP definition format">
    <tr>
        <td width="100px"><strong>Filename</strong></td>
        <td>&#123;=Bundle&#125;_&#123;=LanguageCode&#125;.php</td>
    </tr>
    <tr>
        <td><strong>File Start</strong></td>
        <td>&lt;?php</td>
    </tr>
    <tr>
        <td><strong>File End</strong></td>
        <td>);&nbsp;?&gt;</td>
    </tr>
    <tr>
        <td><strong>Element</strong></td>
        <td>define("&#123;=Element&#125;","&#123;=Translation&#125;");</td>
    </tr>
</table>

</body>
</html>

